/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  
  checkConfig(config);
  @endpoint = getEndpoint('ecd', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model CountAppVersionRequest {
  appId?: long(name='AppId'),
}

model CountAppVersionResponseBody = {
  code?: string(name='Code'),
  data?: long(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model CountAppVersionResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CountAppVersionResponseBody(name='body'),
}

async function countAppVersionWithOptions(request: CountAppVersionRequest, runtime: Util.RuntimeOptions): CountAppVersionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CountAppVersion',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function countAppVersion(request: CountAppVersionRequest): CountAppVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  return countAppVersionWithOptions(request, runtime);
}

model CreateAppRequest {
  description?: string(name='Description'),
  iconUrl?: string(name='IconUrl'),
  name?: string(name='Name'),
  tagList?: [ string ](name='TagList'),
  type?: int32(name='Type'),
}

model CreateAppResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model CreateAppResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateAppResponseBody(name='body'),
}

async function createAppWithOptions(request: CreateAppRequest, runtime: Util.RuntimeOptions): CreateAppResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.iconUrl)) {
    query['IconUrl'] = request.iconUrl;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.tagList)) {
    query['TagList'] = request.tagList;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateApp',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createApp(request: CreateAppRequest): CreateAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAppWithOptions(request, runtime);
}

model CreateAppAdaptorRequest {
  frameRate?: string(name='FrameRate'),
  loadType?: string(name='LoadType'),
  mode?: string(name='Mode'),
  os?: string(name='Os'),
  resolution?: string(name='Resolution'),
  versionUid?: string(name='VersionUid'),
}

model CreateAppAdaptorResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model CreateAppAdaptorResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateAppAdaptorResponseBody(name='body'),
}

async function createAppAdaptorWithOptions(request: CreateAppAdaptorRequest, runtime: Util.RuntimeOptions): CreateAppAdaptorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.frameRate)) {
    query['FrameRate'] = request.frameRate;
  }
  if (!Util.isUnset(request.loadType)) {
    query['LoadType'] = request.loadType;
  }
  if (!Util.isUnset(request.mode)) {
    query['Mode'] = request.mode;
  }
  if (!Util.isUnset(request.os)) {
    query['Os'] = request.os;
  }
  if (!Util.isUnset(request.resolution)) {
    query['Resolution'] = request.resolution;
  }
  if (!Util.isUnset(request.versionUid)) {
    query['VersionUid'] = request.versionUid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateAppAdaptor',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createAppAdaptor(request: CreateAppAdaptorRequest): CreateAppAdaptorResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAppAdaptorWithOptions(request, runtime);
}

model CreateAppAdaptorImageRequest {
  adaptorUid?: string(name='AdaptorUid'),
}

model CreateAppAdaptorImageResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model CreateAppAdaptorImageResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateAppAdaptorImageResponseBody(name='body'),
}

async function createAppAdaptorImageWithOptions(request: CreateAppAdaptorImageRequest, runtime: Util.RuntimeOptions): CreateAppAdaptorImageResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.adaptorUid)) {
    query['AdaptorUid'] = request.adaptorUid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateAppAdaptorImage',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createAppAdaptorImage(request: CreateAppAdaptorImageRequest): CreateAppAdaptorImageResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAppAdaptorImageWithOptions(request, runtime);
}

model CreateAppAdaptorsRequest {
  frameRate?: string(name='FrameRate'),
  loadTypeList?: [ string ](name='LoadTypeList'),
  mode?: string(name='Mode'),
  os?: string(name='Os'),
  resolution?: string(name='Resolution'),
  versionUid?: string(name='VersionUid'),
}

model CreateAppAdaptorsResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      loadType?: string(name='LoadType'),
      uid?: string(name='Uid'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model CreateAppAdaptorsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateAppAdaptorsResponseBody(name='body'),
}

async function createAppAdaptorsWithOptions(request: CreateAppAdaptorsRequest, runtime: Util.RuntimeOptions): CreateAppAdaptorsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.frameRate)) {
    query['FrameRate'] = request.frameRate;
  }
  if (!Util.isUnset(request.loadTypeList)) {
    query['LoadTypeList'] = request.loadTypeList;
  }
  if (!Util.isUnset(request.mode)) {
    query['Mode'] = request.mode;
  }
  if (!Util.isUnset(request.os)) {
    query['Os'] = request.os;
  }
  if (!Util.isUnset(request.resolution)) {
    query['Resolution'] = request.resolution;
  }
  if (!Util.isUnset(request.versionUid)) {
    query['VersionUid'] = request.versionUid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateAppAdaptors',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createAppAdaptors(request: CreateAppAdaptorsRequest): CreateAppAdaptorsResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAppAdaptorsWithOptions(request, runtime);
}

model CreateAppGroupRequest {
  adaptorUidList?: [ string ](name='AdaptorUidList'),
  description?: string(name='Description'),
  groupName?: string(name='GroupName'),
}

model CreateAppGroupResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model CreateAppGroupResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateAppGroupResponseBody(name='body'),
}

async function createAppGroupWithOptions(request: CreateAppGroupRequest, runtime: Util.RuntimeOptions): CreateAppGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.adaptorUidList)) {
    query['AdaptorUidList'] = request.adaptorUidList;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.groupName)) {
    query['GroupName'] = request.groupName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateAppGroup',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createAppGroup(request: CreateAppGroupRequest): CreateAppGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAppGroupWithOptions(request, runtime);
}

model CreateAppGroupImageRequest {
  appGroupUid?: string(name='AppGroupUid'),
}

model CreateAppGroupImageResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model CreateAppGroupImageResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateAppGroupImageResponseBody(name='body'),
}

async function createAppGroupImageWithOptions(request: CreateAppGroupImageRequest, runtime: Util.RuntimeOptions): CreateAppGroupImageResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appGroupUid)) {
    query['AppGroupUid'] = request.appGroupUid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateAppGroupImage',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createAppGroupImage(request: CreateAppGroupImageRequest): CreateAppGroupImageResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAppGroupImageWithOptions(request, runtime);
}

model CreateAppImageRequest {
  adaptorUidList?: [ string ](name='AdaptorUidList'),
  name?: string(name='Name'),
  region?: string(name='Region'),
}

model CreateAppImageResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model CreateAppImageResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateAppImageResponseBody(name='body'),
}

async function createAppImageWithOptions(request: CreateAppImageRequest, runtime: Util.RuntimeOptions): CreateAppImageResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.adaptorUidList)) {
    query['AdaptorUidList'] = request.adaptorUidList;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.region)) {
    query['Region'] = request.region;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateAppImage',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createAppImage(request: CreateAppImageRequest): CreateAppImageResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAppImageWithOptions(request, runtime);
}

model CreateAppImageConfigRequest {
  imgUid?: string(name='ImgUid'),
}

model CreateAppImageConfigResponseBody = {
  code?: string(name='Code'),
  data?: long(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model CreateAppImageConfigResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateAppImageConfigResponseBody(name='body'),
}

async function createAppImageConfigWithOptions(request: CreateAppImageConfigRequest, runtime: Util.RuntimeOptions): CreateAppImageConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.imgUid)) {
    body['ImgUid'] = request.imgUid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateAppImageConfig',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createAppImageConfig(request: CreateAppImageConfigRequest): CreateAppImageConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAppImageConfigWithOptions(request, runtime);
}

model CreateAppTagRequest {
  appUid?: string(name='AppUid'),
  name?: string(name='Name'),
}

model CreateAppTagResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model CreateAppTagResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateAppTagResponseBody(name='body'),
}

async function createAppTagWithOptions(request: CreateAppTagRequest, runtime: Util.RuntimeOptions): CreateAppTagResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appUid)) {
    query['AppUid'] = request.appUid;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateAppTag',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createAppTag(request: CreateAppTagRequest): CreateAppTagResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAppTagWithOptions(request, runtime);
}

model CreateAppVersionRequest {
  appUid?: string(name='AppUid'),
  fileName?: string(name='FileName'),
  filePath?: string(name='FilePath'),
  fileRealName?: string(name='FileRealName'),
  name?: string(name='Name'),
  number?: string(name='Number'),
  osType?: string(name='OsType'),
}

model CreateAppVersionResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model CreateAppVersionResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateAppVersionResponseBody(name='body'),
}

async function createAppVersionWithOptions(request: CreateAppVersionRequest, runtime: Util.RuntimeOptions): CreateAppVersionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appUid)) {
    query['AppUid'] = request.appUid;
  }
  if (!Util.isUnset(request.fileName)) {
    query['FileName'] = request.fileName;
  }
  if (!Util.isUnset(request.filePath)) {
    query['FilePath'] = request.filePath;
  }
  if (!Util.isUnset(request.fileRealName)) {
    query['FileRealName'] = request.fileRealName;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.number)) {
    query['Number'] = request.number;
  }
  if (!Util.isUnset(request.osType)) {
    query['OsType'] = request.osType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateAppVersion',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createAppVersion(request: CreateAppVersionRequest): CreateAppVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAppVersionWithOptions(request, runtime);
}

model CreateAppVersionAdaptorRequest {
  computeType?: string(name='ComputeType'),
  extensions?: map[string]any(name='Extensions'),
  frameRate?: string(name='FrameRate'),
  hardware?: string(name='Hardware'),
  mode?: string(name='Mode'),
  os?: string(name='Os'),
  resolution?: string(name='Resolution'),
  versionId?: long(name='VersionId'),
}

model CreateAppVersionAdaptorShrinkRequest {
  computeType?: string(name='ComputeType'),
  extensionsShrink?: string(name='Extensions'),
  frameRate?: string(name='FrameRate'),
  hardware?: string(name='Hardware'),
  mode?: string(name='Mode'),
  os?: string(name='Os'),
  resolution?: string(name='Resolution'),
  versionId?: long(name='VersionId'),
}

model CreateAppVersionAdaptorResponseBody = {
  code?: string(name='Code'),
  data?: long(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model CreateAppVersionAdaptorResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateAppVersionAdaptorResponseBody(name='body'),
}

async function createAppVersionAdaptorWithOptions(tmpReq: CreateAppVersionAdaptorRequest, runtime: Util.RuntimeOptions): CreateAppVersionAdaptorResponse {
  Util.validateModel(tmpReq);
  var request = new CreateAppVersionAdaptorShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.extensions)) {
    request.extensionsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.extensions, 'Extensions', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.computeType)) {
    query['ComputeType'] = request.computeType;
  }
  if (!Util.isUnset(request.extensionsShrink)) {
    query['Extensions'] = request.extensionsShrink;
  }
  if (!Util.isUnset(request.frameRate)) {
    query['FrameRate'] = request.frameRate;
  }
  if (!Util.isUnset(request.hardware)) {
    query['Hardware'] = request.hardware;
  }
  if (!Util.isUnset(request.mode)) {
    query['Mode'] = request.mode;
  }
  if (!Util.isUnset(request.os)) {
    query['Os'] = request.os;
  }
  if (!Util.isUnset(request.resolution)) {
    query['Resolution'] = request.resolution;
  }
  if (!Util.isUnset(request.versionId)) {
    query['VersionId'] = request.versionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateAppVersionAdaptor',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createAppVersionAdaptor(request: CreateAppVersionAdaptorRequest): CreateAppVersionAdaptorResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAppVersionAdaptorWithOptions(request, runtime);
}

model DeleteAppRequest {
  uid?: string(name='Uid'),
}

model DeleteAppResponseBody = {
  code?: string(name='Code'),
  data?: boolean(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model DeleteAppResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteAppResponseBody(name='body'),
}

async function deleteAppWithOptions(request: DeleteAppRequest, runtime: Util.RuntimeOptions): DeleteAppResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteApp',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteApp(request: DeleteAppRequest): DeleteAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAppWithOptions(request, runtime);
}

model DeleteAppAdaptorRequest {
  uid?: string(name='Uid'),
}

model DeleteAppAdaptorResponseBody = {
  code?: string(name='Code'),
  data?: boolean(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model DeleteAppAdaptorResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteAppAdaptorResponseBody(name='body'),
}

async function deleteAppAdaptorWithOptions(request: DeleteAppAdaptorRequest, runtime: Util.RuntimeOptions): DeleteAppAdaptorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAppAdaptor',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteAppAdaptor(request: DeleteAppAdaptorRequest): DeleteAppAdaptorResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAppAdaptorWithOptions(request, runtime);
}

model DeleteAppGroupRequest {
  uid?: string(name='Uid'),
}

model DeleteAppGroupResponseBody = {
  code?: string(name='Code'),
  data?: boolean(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model DeleteAppGroupResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteAppGroupResponseBody(name='body'),
}

async function deleteAppGroupWithOptions(request: DeleteAppGroupRequest, runtime: Util.RuntimeOptions): DeleteAppGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAppGroup',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteAppGroup(request: DeleteAppGroupRequest): DeleteAppGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAppGroupWithOptions(request, runtime);
}

model DeleteAppGroupImageRequest {
  uid?: string(name='Uid'),
}

model DeleteAppGroupImageResponseBody = {
  code?: string(name='Code'),
  data?: boolean(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model DeleteAppGroupImageResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteAppGroupImageResponseBody(name='body'),
}

async function deleteAppGroupImageWithOptions(request: DeleteAppGroupImageRequest, runtime: Util.RuntimeOptions): DeleteAppGroupImageResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAppGroupImage',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteAppGroupImage(request: DeleteAppGroupImageRequest): DeleteAppGroupImageResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAppGroupImageWithOptions(request, runtime);
}

model DeleteAppImageRequest {
  id?: long(name='Id'),
  uid?: string(name='Uid'),
}

model DeleteAppImageResponseBody = {
  code?: string(name='Code'),
  data?: boolean(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeleteAppImageResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteAppImageResponseBody(name='body'),
}

async function deleteAppImageWithOptions(request: DeleteAppImageRequest, runtime: Util.RuntimeOptions): DeleteAppImageResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  if (!Util.isUnset(request.uid)) {
    body['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAppImage',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteAppImage(request: DeleteAppImageRequest): DeleteAppImageResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAppImageWithOptions(request, runtime);
}

model DeleteAppTagRequest {
  uid?: string(name='Uid'),
}

model DeleteAppTagResponseBody = {
  code?: string(name='Code'),
  data?: boolean(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model DeleteAppTagResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteAppTagResponseBody(name='body'),
}

async function deleteAppTagWithOptions(request: DeleteAppTagRequest, runtime: Util.RuntimeOptions): DeleteAppTagResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAppTag',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteAppTag(request: DeleteAppTagRequest): DeleteAppTagResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAppTagWithOptions(request, runtime);
}

model DeleteAppVersionRequest {
  uid?: string(name='Uid'),
}

model DeleteAppVersionResponseBody = {
  code?: string(name='Code'),
  data?: boolean(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model DeleteAppVersionResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteAppVersionResponseBody(name='body'),
}

async function deleteAppVersionWithOptions(request: DeleteAppVersionRequest, runtime: Util.RuntimeOptions): DeleteAppVersionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAppVersion',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteAppVersion(request: DeleteAppVersionRequest): DeleteAppVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAppVersionWithOptions(request, runtime);
}

model DeleteAppVersionAdaptorRequest {
  ids?: map[string]any(name='Ids'),
  versionId?: long(name='VersionId'),
}

model DeleteAppVersionAdaptorShrinkRequest {
  idsShrink?: string(name='Ids'),
  versionId?: long(name='VersionId'),
}

model DeleteAppVersionAdaptorResponseBody = {
  code?: string(name='Code'),
  data?: boolean(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model DeleteAppVersionAdaptorResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteAppVersionAdaptorResponseBody(name='body'),
}

async function deleteAppVersionAdaptorWithOptions(tmpReq: DeleteAppVersionAdaptorRequest, runtime: Util.RuntimeOptions): DeleteAppVersionAdaptorResponse {
  Util.validateModel(tmpReq);
  var request = new DeleteAppVersionAdaptorShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.ids)) {
    request.idsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.ids, 'Ids', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.idsShrink)) {
    query['Ids'] = request.idsShrink;
  }
  if (!Util.isUnset(request.versionId)) {
    query['VersionId'] = request.versionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAppVersionAdaptor',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteAppVersionAdaptor(request: DeleteAppVersionAdaptorRequest): DeleteAppVersionAdaptorResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAppVersionAdaptorWithOptions(request, runtime);
}

model GetAppRequest {
  uid?: string(name='Uid'),
}

model GetAppResponseBody = {
  code?: string(name='Code'),
  data?: {
    description?: string(name='Description'),
    gmtCreate?: string(name='GmtCreate'),
    gmtModified?: string(name='GmtModified'),
    iconUrl?: string(name='IconUrl'),
    name?: string(name='Name'),
    status?: int32(name='Status'),
    tagList?: string(name='TagList'),
    uid?: string(name='Uid'),
    versionCount?: int32(name='VersionCount'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model GetAppResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetAppResponseBody(name='body'),
}

async function getAppWithOptions(request: GetAppRequest, runtime: Util.RuntimeOptions): GetAppResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetApp',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getApp(request: GetAppRequest): GetAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAppWithOptions(request, runtime);
}

model GetAppAdaptorRequest {
  uid?: string(name='Uid'),
}

model GetAppAdaptorResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      bitrate?: string(name='Bitrate'),
      frameRate?: string(name='FrameRate'),
      gmtCreate?: string(name='GmtCreate'),
      gmtModified?: string(name='GmtModified'),
      hardware?: string(name='Hardware'),
      loadType?: string(name='LoadType'),
      mode?: string(name='Mode'),
      os?: string(name='Os'),
      osType?: string(name='OsType'),
      resolution?: string(name='Resolution'),
      status?: int32(name='Status'),
      uid?: string(name='Uid'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: long(name='TotalCount'),
}

model GetAppAdaptorResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetAppAdaptorResponseBody(name='body'),
}

async function getAppAdaptorWithOptions(request: GetAppAdaptorRequest, runtime: Util.RuntimeOptions): GetAppAdaptorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAppAdaptor',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAppAdaptor(request: GetAppAdaptorRequest): GetAppAdaptorResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAppAdaptorWithOptions(request, runtime);
}

model GetAppAdaptorConfigResponseBody = {
  code?: string(name='Code'),
  data?: {
    appType?: string(name='AppType'),
    framerate?: string(name='Framerate'),
    loadType?: string(name='LoadType'),
    mode?: string(name='Mode'),
    name?: string(name='Name'),
    resolution?: string(name='Resolution'),
    system?: string(name='System'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model GetAppAdaptorConfigResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetAppAdaptorConfigResponseBody(name='body'),
}

async function getAppAdaptorConfigWithOptions(runtime: Util.RuntimeOptions): GetAppAdaptorConfigResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'GetAppAdaptorConfig',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAppAdaptorConfig(): GetAppAdaptorConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAppAdaptorConfigWithOptions(runtime);
}

model GetAppAdaptorReportRequest {
  adaptorUid?: string(name='AdaptorUid'),
}

model GetAppAdaptorReportResponseBody = {
  code?: string(name='Code'),
  data?: {
    adaptorUid?: string(name='AdaptorUid'),
    appInstanceType?: string(name='AppInstanceType'),
    appScript?: string(name='AppScript'),
    bandwidth?: string(name='Bandwidth'),
    bitrate?: string(name='Bitrate'),
    frameRate?: string(name='FrameRate'),
    instanceType?: string(name='InstanceType'),
    loadType?: string(name='LoadType'),
    mode?: string(name='Mode'),
    os?: string(name='Os'),
    osType?: string(name='OsType'),
    resolution?: string(name='Resolution'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model GetAppAdaptorReportResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetAppAdaptorReportResponseBody(name='body'),
}

async function getAppAdaptorReportWithOptions(request: GetAppAdaptorReportRequest, runtime: Util.RuntimeOptions): GetAppAdaptorReportResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.adaptorUid)) {
    query['AdaptorUid'] = request.adaptorUid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAppAdaptorReport',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAppAdaptorReport(request: GetAppAdaptorReportRequest): GetAppAdaptorReportResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAppAdaptorReportWithOptions(request, runtime);
}

model GetAppDownloadUrlRequest {
  accountId?: long(name='AccountId'),
  appId?: long(name='AppId'),
  regionId?: string(name='RegionId'),
}

model GetAppDownloadUrlResponseBody = {
  code?: string(name='Code'),
  data?: {
    url?: string(name='Url'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model GetAppDownloadUrlResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetAppDownloadUrlResponseBody(name='body'),
}

async function getAppDownloadUrlWithOptions(request: GetAppDownloadUrlRequest, runtime: Util.RuntimeOptions): GetAppDownloadUrlResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountId)) {
    query['AccountId'] = request.accountId;
  }
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAppDownloadUrl',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAppDownloadUrl(request: GetAppDownloadUrlRequest): GetAppDownloadUrlResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAppDownloadUrlWithOptions(request, runtime);
}

model GetAppImageRequest {
  imageId?: string(name='ImageId'),
}

model GetAppImageResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      adaptor?: string(name='Adaptor'),
      adaptorId?: long(name='AdaptorId'),
      aliyunImageId?: string(name='AliyunImageId'),
      apps?: string(name='Apps'),
      delete?: int32(name='Delete'),
      distributeStatus?: int32(name='DistributeStatus'),
      gmtCreate?: string(name='GmtCreate'),
      gmtModified?: string(name='GmtModified'),
      id?: long(name='Id'),
      ossUrl?: string(name='OssUrl'),
      status?: int32(name='Status'),
      uid?: string(name='Uid'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model GetAppImageResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetAppImageResponseBody(name='body'),
}

async function getAppImageWithOptions(request: GetAppImageRequest, runtime: Util.RuntimeOptions): GetAppImageResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.imageId)) {
    query['ImageId'] = request.imageId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAppImage',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAppImage(request: GetAppImageRequest): GetAppImageResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAppImageWithOptions(request, runtime);
}

model GetAppImageStatusRequest {
  imageUid?: string(name='ImageUid'),
  osType?: string(name='OsType'),
}

model GetAppImageStatusResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      appImage?: string(name='AppImage'),
      edsAgentVersion?: string(name='Eds_agent_version'),
      progress?: string(name='Progress'),
      region?: string(name='Region'),
      status?: int32(name='Status'),
      sysImage?: string(name='SysImage'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  totalCount?: long(name='TotalCount'),
}

model GetAppImageStatusResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetAppImageStatusResponseBody(name='body'),
}

async function getAppImageStatusWithOptions(request: GetAppImageStatusRequest, runtime: Util.RuntimeOptions): GetAppImageStatusResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.imageUid)) {
    body['ImageUid'] = request.imageUid;
  }
  if (!Util.isUnset(request.osType)) {
    body['OsType'] = request.osType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetAppImageStatus',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAppImageStatus(request: GetAppImageStatusRequest): GetAppImageStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAppImageStatusWithOptions(request, runtime);
}

model GetAppStsCredentialRequest {
  accountId?: long(name='AccountId'),
  regionId?: string(name='RegionId'),
  sourceType?: int32(name='SourceType'),
}

model GetAppStsCredentialResponseBody = {
  code?: string(name='Code'),
  data?: {
    accessKeyId?: string(name='AccessKeyId'),
    accessKeySecret?: string(name='AccessKeySecret'),
    bucketName?: string(name='BucketName'),
    filePath?: string(name='FilePath'),
    ossPoint?: string(name='OssPoint'),
    stsToken?: string(name='StsToken'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model GetAppStsCredentialResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetAppStsCredentialResponseBody(name='body'),
}

async function getAppStsCredentialWithOptions(request: GetAppStsCredentialRequest, runtime: Util.RuntimeOptions): GetAppStsCredentialResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountId)) {
    query['AccountId'] = request.accountId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.sourceType)) {
    query['SourceType'] = request.sourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAppStsCredential',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAppStsCredential(request: GetAppStsCredentialRequest): GetAppStsCredentialResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAppStsCredentialWithOptions(request, runtime);
}

model GetAppVersionRequest {
  id?: long(name='Id'),
  uid?: string(name='Uid'),
}

model GetAppVersionResponseBody = {
  code?: string(name='Code'),
  data?: {
    adaptorComplishCount?: long(name='AdaptorComplishCount'),
    adaptorCount?: long(name='AdaptorCount'),
    gmtCreate?: string(name='GmtCreate'),
    gmtModified?: string(name='GmtModified'),
    id?: long(name='Id'),
    listAdaptor?: string(name='ListAdaptor'),
    name?: string(name='Name'),
    number?: string(name='Number'),
    os?: string(name='Os'),
    osType?: string(name='OsType'),
    size?: long(name='Size'),
    uid?: string(name='Uid'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model GetAppVersionResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetAppVersionResponseBody(name='body'),
}

async function getAppVersionWithOptions(request: GetAppVersionRequest, runtime: Util.RuntimeOptions): GetAppVersionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAppVersion',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAppVersion(request: GetAppVersionRequest): GetAppVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAppVersionWithOptions(request, runtime);
}

model GetCreateGroupFlagResponseBody = {
  code?: string(name='Code'),
  data?: boolean(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model GetCreateGroupFlagResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetCreateGroupFlagResponseBody(name='body'),
}

async function getCreateGroupFlagWithOptions(runtime: Util.RuntimeOptions): GetCreateGroupFlagResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'GetCreateGroupFlag',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getCreateGroupFlag(): GetCreateGroupFlagResponse {
  var runtime = new Util.RuntimeOptions{};
  return getCreateGroupFlagWithOptions(runtime);
}

model GetDownloadStsCredentialRequest {
  accountId?: long(name='AccountId'),
  appId?: long(name='AppId'),
  regionId?: string(name='RegionId'),
}

model GetDownloadStsCredentialResponseBody = {
  code?: string(name='Code'),
  data?: {
    accessKeyId?: string(name='AccessKeyId'),
    accessKeySecret?: string(name='AccessKeySecret'),
    bucketName?: string(name='BucketName'),
    ossPoint?: string(name='OssPoint'),
    stsToken?: string(name='StsToken'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model GetDownloadStsCredentialResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetDownloadStsCredentialResponseBody(name='body'),
}

async function getDownloadStsCredentialWithOptions(request: GetDownloadStsCredentialRequest, runtime: Util.RuntimeOptions): GetDownloadStsCredentialResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountId)) {
    query['AccountId'] = request.accountId;
  }
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetDownloadStsCredential',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getDownloadStsCredential(request: GetDownloadStsCredentialRequest): GetDownloadStsCredentialResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDownloadStsCredentialWithOptions(request, runtime);
}

model GetIconDownloadUrlRequest {
  accountId?: long(name='AccountId'),
  appId?: long(name='AppId'),
  regionId?: string(name='RegionId'),
}

model GetIconDownloadUrlResponseBody = {
  code?: string(name='Code'),
  data?: {
    url?: string(name='Url'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model GetIconDownloadUrlResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetIconDownloadUrlResponseBody(name='body'),
}

async function getIconDownloadUrlWithOptions(request: GetIconDownloadUrlRequest, runtime: Util.RuntimeOptions): GetIconDownloadUrlResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountId)) {
    query['AccountId'] = request.accountId;
  }
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetIconDownloadUrl',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getIconDownloadUrl(request: GetIconDownloadUrlRequest): GetIconDownloadUrlResponse {
  var runtime = new Util.RuntimeOptions{};
  return getIconDownloadUrlWithOptions(request, runtime);
}

model GetIconStsCredentialRequest {
  accountId?: long(name='AccountId'),
  regionId?: string(name='RegionId'),
  sourceType?: int32(name='SourceType'),
}

model GetIconStsCredentialResponseBody = {
  code?: string(name='Code'),
  data?: {
    accessKeyId?: string(name='AccessKeyId'),
    accessKeySecret?: string(name='AccessKeySecret'),
    bucketName?: string(name='BucketName'),
    filePath?: string(name='FilePath'),
    ossPoint?: string(name='OssPoint'),
    stsToken?: string(name='StsToken'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model GetIconStsCredentialResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetIconStsCredentialResponseBody(name='body'),
}

async function getIconStsCredentialWithOptions(request: GetIconStsCredentialRequest, runtime: Util.RuntimeOptions): GetIconStsCredentialResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountId)) {
    query['AccountId'] = request.accountId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.sourceType)) {
    query['SourceType'] = request.sourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetIconStsCredential',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getIconStsCredential(request: GetIconStsCredentialRequest): GetIconStsCredentialResponse {
  var runtime = new Util.RuntimeOptions{};
  return getIconStsCredentialWithOptions(request, runtime);
}

model ListAppRequest {
  name?: string(name='Name'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  status?: int32(name='Status'),
  type?: int32(name='Type'),
  uid?: string(name='Uid'),
}

model ListAppResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      description?: string(name='Description'),
      gmtCreate?: string(name='GmtCreate'),
      gmtModified?: string(name='GmtModified'),
      iconUrl?: string(name='IconUrl'),
      name?: string(name='Name'),
      status?: int32(name='Status'),
      tagList?: string(name='TagList'),
      type?: int32(name='Type'),
      uid?: string(name='Uid'),
      versionCount?: int32(name='VersionCount'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: long(name='TotalCount'),
}

model ListAppResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListAppResponseBody(name='body'),
}

async function listAppWithOptions(request: ListAppRequest, runtime: Util.RuntimeOptions): ListAppResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListApp',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listApp(request: ListAppRequest): ListAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAppWithOptions(request, runtime);
}

model ListAppAdaptorsRequest {
  appName?: string(name='AppName'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  status?: int32(name='Status'),
  type?: int32(name='Type'),
  uid?: string(name='Uid'),
  versionUid?: string(name='VersionUid'),
}

model ListAppAdaptorsResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      adaptorMessage?: string(name='AdaptorMessage'),
      appInstanceType?: string(name='AppInstanceType'),
      appName?: string(name='AppName'),
      appUid?: string(name='AppUid'),
      bitrate?: string(name='Bitrate'),
      delete?: int32(name='Delete'),
      distributeStatus?: int32(name='DistributeStatus'),
      frameRate?: string(name='FrameRate'),
      gmtCreate?: string(name='GmtCreate'),
      gmtModified?: string(name='GmtModified'),
      hardware?: string(name='Hardware'),
      instanceType?: string(name='InstanceType'),
      loadType?: string(name='LoadType'),
      mode?: string(name='Mode'),
      os?: string(name='Os'),
      osType?: string(name='OsType'),
      reportUrl?: long(name='ReportUrl'),
      resolution?: string(name='Resolution'),
      runtimeEnv?: long(name='RuntimeEnv'),
      status?: int32(name='Status'),
      uid?: string(name='Uid'),
      versionName?: string(name='VersionName'),
      versionNumber?: string(name='VersionNumber'),
      versionUid?: string(name='VersionUid'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: long(name='TotalCount'),
}

model ListAppAdaptorsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListAppAdaptorsResponseBody(name='body'),
}

async function listAppAdaptorsWithOptions(request: ListAppAdaptorsRequest, runtime: Util.RuntimeOptions): ListAppAdaptorsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  if (!Util.isUnset(request.versionUid)) {
    query['VersionUid'] = request.versionUid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAppAdaptors',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listAppAdaptors(request: ListAppAdaptorsRequest): ListAppAdaptorsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAppAdaptorsWithOptions(request, runtime);
}

model ListAppGroupRequest {
  groupName?: string(name='GroupName'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  type?: int32(name='Type'),
  uid?: string(name='Uid'),
}

model ListAppGroupResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      adaptorCount?: long(name='AdaptorCount'),
      description?: string(name='Description'),
      groupName?: string(name='GroupName'),
      loadType?: string(name='LoadType'),
      os?: string(name='Os'),
      osType?: string(name='OsType'),
      status?: string(name='Status'),
      uid?: string(name='Uid'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: long(name='TotalCount'),
}

model ListAppGroupResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListAppGroupResponseBody(name='body'),
}

async function listAppGroupWithOptions(request: ListAppGroupRequest, runtime: Util.RuntimeOptions): ListAppGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupName)) {
    query['GroupName'] = request.groupName;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAppGroup',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listAppGroup(request: ListAppGroupRequest): ListAppGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAppGroupWithOptions(request, runtime);
}

model ListAppGroupAdaptorRequest {
  groupId?: long(name='GroupId'),
  groupUid?: string(name='GroupUid'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  type?: int32(name='Type'),
}

model ListAppGroupAdaptorResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      appName?: string(name='AppName'),
      appVersionName?: string(name='AppVersionName'),
      appVersionNumber?: string(name='AppVersionNumber'),
      fileSize?: long(name='FileSize'),
      uid?: string(name='Uid'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model ListAppGroupAdaptorResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListAppGroupAdaptorResponseBody(name='body'),
}

async function listAppGroupAdaptorWithOptions(request: ListAppGroupAdaptorRequest, runtime: Util.RuntimeOptions): ListAppGroupAdaptorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.groupUid)) {
    query['GroupUid'] = request.groupUid;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAppGroupAdaptor',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listAppGroupAdaptor(request: ListAppGroupAdaptorRequest): ListAppGroupAdaptorResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAppGroupAdaptorWithOptions(request, runtime);
}

model ListAppGroupImagesRequest {
  appGroupName?: string(name='AppGroupName'),
  appGroupUid?: string(name='AppGroupUid'),
  imageUid?: string(name='ImageUid'),
  os?: string(name='Os'),
  osType?: string(name='OsType'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  status?: int32(name='Status'),
  type?: int32(name='Type'),
  willDistribute?: boolean(name='WillDistribute'),
}

model ListAppGroupImagesResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      adaptorCount?: int32(name='AdaptorCount'),
      groupName?: string(name='GroupName'),
      id?: long(name='Id'),
      imageUid?: string(name='ImageUid'),
      loadType?: string(name='LoadType'),
      os?: string(name='Os'),
      osType?: string(name='OsType'),
      status?: string(name='Status'),
      uid?: string(name='Uid'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: long(name='TotalCount'),
}

model ListAppGroupImagesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListAppGroupImagesResponseBody(name='body'),
}

async function listAppGroupImagesWithOptions(request: ListAppGroupImagesRequest, runtime: Util.RuntimeOptions): ListAppGroupImagesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appGroupName)) {
    query['AppGroupName'] = request.appGroupName;
  }
  if (!Util.isUnset(request.appGroupUid)) {
    query['AppGroupUid'] = request.appGroupUid;
  }
  if (!Util.isUnset(request.imageUid)) {
    query['ImageUid'] = request.imageUid;
  }
  if (!Util.isUnset(request.os)) {
    query['Os'] = request.os;
  }
  if (!Util.isUnset(request.osType)) {
    query['OsType'] = request.osType;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  if (!Util.isUnset(request.willDistribute)) {
    query['WillDistribute'] = request.willDistribute;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAppGroupImages',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listAppGroupImages(request: ListAppGroupImagesRequest): ListAppGroupImagesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAppGroupImagesWithOptions(request, runtime);
}

model ListAppImageRequest {
  appName?: string(name='AppName'),
  appUid?: string(name='AppUid'),
  imageName?: string(name='ImageName'),
  imageUid?: string(name='ImageUid'),
  os?: string(name='Os'),
  osType?: string(name='OsType'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  regionIdList?: [ string ](name='RegionIdList'),
  status?: int32(name='Status'),
  type?: int32(name='Type'),
  willDistribute?: boolean(name='WillDistribute'),
}

model ListAppImageShrinkRequest {
  appName?: string(name='AppName'),
  appUid?: string(name='AppUid'),
  imageName?: string(name='ImageName'),
  imageUid?: string(name='ImageUid'),
  os?: string(name='Os'),
  osType?: string(name='OsType'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  regionIdListShrink?: string(name='RegionIdList'),
  status?: int32(name='Status'),
  type?: int32(name='Type'),
  willDistribute?: boolean(name='WillDistribute'),
}

model ListAppImageResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      adaptor?: {
        adaptorMessage?: string(name='AdaptorMessage'),
        appIconUrl?: string(name='AppIconUrl'),
        appId?: long(name='AppId'),
        appInstanceType?: string(name='AppInstanceType'),
        appName?: string(name='AppName'),
        appScript?: string(name='AppScript'),
        appType?: int32(name='AppType'),
        appUid?: string(name='AppUid'),
        appVersionName?: string(name='AppVersionName'),
        appVersionNumber?: string(name='AppVersionNumber'),
        bitrate?: string(name='Bitrate'),
        categoryId?: int32(name='CategoryId'),
        categoryType?: int32(name='CategoryType'),
        delete?: int32(name='Delete'),
        disActive?: boolean(name='DisActive'),
        distributeStatus?: int32(name='DistributeStatus'),
        fileSize?: long(name='FileSize'),
        frameRate?: string(name='FrameRate'),
        gmtCreate?: string(name='GmtCreate'),
        gmtModified?: string(name='GmtModified'),
        id?: long(name='Id'),
        instanceType?: string(name='InstanceType'),
        isLoginFree?: boolean(name='IsLoginFree'),
        loadType?: string(name='LoadType'),
        loginConfig?: string(name='LoginConfig'),
        mode?: string(name='Mode'),
        originAppType?: int32(name='OriginAppType'),
        os?: string(name='Os'),
        osType?: string(name='OsType'),
        platform?: string(name='Platform'),
        resolution?: string(name='Resolution'),
        status?: int32(name='Status'),
        subAppType?: string(name='SubAppType'),
        uid?: string(name='Uid'),
        versionId?: long(name='VersionId'),
        versionUid?: string(name='VersionUid'),
      }(name='Adaptor'),
      adaptorId?: long(name='AdaptorId'),
      adaptorUid?: string(name='AdaptorUid'),
      aliyunImageConfig?: string(name='AliyunImageConfig'),
      aliyunImageId?: string(name='AliyunImageId'),
      aliyunuid?: long(name='Aliyunuid'),
      appAdaptorList?: [ 
        {
          adaptorMessage?: string(name='AdaptorMessage'),
          appIconUrl?: string(name='AppIconUrl'),
          appId?: long(name='AppId'),
          appInstanceType?: string(name='AppInstanceType'),
          appName?: string(name='AppName'),
          appScript?: string(name='AppScript'),
          appType?: int32(name='AppType'),
          appUid?: string(name='AppUid'),
          appVersionName?: string(name='AppVersionName'),
          appVersionNumber?: string(name='AppVersionNumber'),
          bitrate?: string(name='Bitrate'),
          categoryId?: int32(name='CategoryId'),
          categoryType?: int32(name='CategoryType'),
          delete?: int32(name='Delete'),
          disActive?: boolean(name='DisActive'),
          distributeStatus?: int32(name='DistributeStatus'),
          fileSize?: long(name='FileSize'),
          frameRate?: string(name='FrameRate'),
          gmtCreate?: string(name='GmtCreate'),
          gmtModified?: string(name='GmtModified'),
          id?: long(name='Id'),
          instanceType?: string(name='InstanceType'),
          isLoginFree?: boolean(name='IsLoginFree'),
          loadType?: string(name='LoadType'),
          loginConfig?: string(name='LoginConfig'),
          mode?: string(name='Mode'),
          originAppType?: int32(name='OriginAppType'),
          os?: string(name='Os'),
          osType?: string(name='OsType'),
          platform?: string(name='Platform'),
          resolution?: string(name='Resolution'),
          status?: int32(name='Status'),
          subAppType?: string(name='SubAppType'),
          uid?: string(name='Uid'),
          versionId?: long(name='VersionId'),
          versionUid?: string(name='VersionUid'),
        }
      ](name='AppAdaptorList'),
      appGroupId?: long(name='AppGroupId'),
      appGroupUid?: string(name='AppGroupUid'),
      appName?: string(name='AppName'),
      appScript?: string(name='AppScript'),
      appType?: int32(name='AppType'),
      appUid?: string(name='AppUid'),
      appVersionName?: string(name='AppVersionName'),
      appVersionNumber?: string(name='AppVersionNumber'),
      apps?: [ 
        {
          description?: string(name='Description'),
          gmtCreate?: string(name='GmtCreate'),
          gmtModified?: string(name='GmtModified'),
          iconUrl?: string(name='IconUrl'),
          id?: long(name='Id'),
          name?: string(name='Name'),
          status?: int32(name='Status'),
          tagList?: [ 
            {
              appId?: long(name='AppId'),
              appUid?: string(name='AppUid'),
              id?: long(name='Id'),
              name?: string(name='Name'),
              uid?: string(name='Uid'),
            }
          ](name='TagList'),
          type?: int32(name='Type'),
          uid?: string(name='Uid'),
          versionCount?: long(name='VersionCount'),
          versionList?: [ 
            {
              adaptorComplishCount?: long(name='AdaptorComplishCount'),
              adaptorCount?: long(name='AdaptorCount'),
              fileName?: string(name='FileName'),
              filePath?: string(name='FilePath'),
              fileRealName?: string(name='FileRealName'),
              gmtCreate?: string(name='GmtCreate'),
              gmtModified?: string(name='GmtModified'),
              id?: long(name='Id'),
              listAdaptor?: [ 
                {
                  adaptorMessage?: string(name='AdaptorMessage'),
                  appIconUrl?: string(name='AppIconUrl'),
                  appId?: long(name='AppId'),
                  appInstanceType?: string(name='AppInstanceType'),
                  appName?: string(name='AppName'),
                  appScript?: string(name='AppScript'),
                  appType?: int32(name='AppType'),
                  appUid?: string(name='AppUid'),
                  appVersionName?: string(name='AppVersionName'),
                  appVersionNumber?: string(name='AppVersionNumber'),
                  bitrate?: string(name='Bitrate'),
                  categoryId?: int32(name='CategoryId'),
                  categoryType?: int32(name='CategoryType'),
                  delete?: int32(name='Delete'),
                  disActive?: boolean(name='DisActive'),
                  distributeStatus?: int32(name='DistributeStatus'),
                  fileSize?: long(name='FileSize'),
                  frameRate?: string(name='FrameRate'),
                  gmtCreate?: string(name='GmtCreate'),
                  gmtModified?: string(name='GmtModified'),
                  id?: long(name='Id'),
                  instanceType?: string(name='InstanceType'),
                  isLoginFree?: boolean(name='IsLoginFree'),
                  loadType?: string(name='LoadType'),
                  loginConfig?: string(name='LoginConfig'),
                  mode?: string(name='Mode'),
                  originAppType?: int32(name='OriginAppType'),
                  os?: string(name='Os'),
                  osType?: string(name='OsType'),
                  platform?: string(name='Platform'),
                  resolution?: string(name='Resolution'),
                  status?: int32(name='Status'),
                  subAppType?: string(name='SubAppType'),
                  uid?: string(name='Uid'),
                  versionId?: long(name='VersionId'),
                  versionUid?: string(name='VersionUid'),
                }
              ](name='ListAdaptor'),
              name?: string(name='Name'),
              number?: string(name='Number'),
              osType?: string(name='OsType'),
              size?: long(name='Size'),
              uid?: string(name='Uid'),
            }
          ](name='VersionList'),
          versionName?: string(name='VersionName'),
          versionNumber?: string(name='VersionNumber'),
        }
      ](name='Apps'),
      delete?: int32(name='Delete'),
      distributeStatus?: int32(name='DistributeStatus'),
      gmtCreate?: string(name='GmtCreate'),
      gmtModified?: string(name='GmtModified'),
      id?: long(name='Id'),
      imageConfigDTOS?: [ 
        {
          appImage?: string(name='AppImage'),
          region?: string(name='Region'),
          sysImage?: string(name='SysImage'),
        }
      ](name='ImageConfigDTOS'),
      loadType?: string(name='LoadType'),
      name?: string(name='Name'),
      os?: string(name='Os'),
      osType?: string(name='OsType'),
      ossUrl?: string(name='OssUrl'),
      otaStatus?: int32(name='OtaStatus'),
      otaVersion?: string(name='OtaVersion'),
      platform?: string(name='Platform'),
      regionStatus?: int32(name='RegionStatus'),
      status?: int32(name='Status'),
      uid?: string(name='Uid'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  totalCount?: long(name='TotalCount'),
}

model ListAppImageResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListAppImageResponseBody(name='body'),
}

async function listAppImageWithOptions(tmpReq: ListAppImageRequest, runtime: Util.RuntimeOptions): ListAppImageResponse {
  Util.validateModel(tmpReq);
  var request = new ListAppImageShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.regionIdList)) {
    request.regionIdListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.regionIdList, 'RegionIdList', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.regionIdListShrink)) {
    query['RegionIdList'] = request.regionIdListShrink;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appName)) {
    body['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.appUid)) {
    body['AppUid'] = request.appUid;
  }
  if (!Util.isUnset(request.imageName)) {
    body['ImageName'] = request.imageName;
  }
  if (!Util.isUnset(request.imageUid)) {
    body['ImageUid'] = request.imageUid;
  }
  if (!Util.isUnset(request.os)) {
    body['Os'] = request.os;
  }
  if (!Util.isUnset(request.osType)) {
    body['OsType'] = request.osType;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.status)) {
    body['Status'] = request.status;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }
  if (!Util.isUnset(request.willDistribute)) {
    body['WillDistribute'] = request.willDistribute;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListAppImage',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listAppImage(request: ListAppImageRequest): ListAppImageResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAppImageWithOptions(request, runtime);
}

model ListAppImagesRequest {
  appName?: string(name='AppName'),
  appUid?: string(name='AppUid'),
  imageUid?: string(name='ImageUid'),
  os?: string(name='Os'),
  osType?: string(name='OsType'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  status?: int32(name='Status'),
  type?: int32(name='Type'),
  willDistribute?: boolean(name='WillDistribute'),
}

model ListAppImagesResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      adaptorUid?: string(name='AdaptorUid'),
      appName?: string(name='AppName'),
      appUid?: string(name='AppUid'),
      appVersionName?: string(name='AppVersionName'),
      appVersionNumber?: string(name='AppVersionNumber'),
      loadType?: string(name='LoadType'),
      name?: string(name='Name'),
      os?: string(name='Os'),
      osType?: string(name='OsType'),
      status?: int32(name='Status'),
      uid?: string(name='Uid'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: long(name='TotalCount'),
}

model ListAppImagesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListAppImagesResponseBody(name='body'),
}

async function listAppImagesWithOptions(request: ListAppImagesRequest, runtime: Util.RuntimeOptions): ListAppImagesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.appUid)) {
    query['AppUid'] = request.appUid;
  }
  if (!Util.isUnset(request.imageUid)) {
    query['ImageUid'] = request.imageUid;
  }
  if (!Util.isUnset(request.os)) {
    query['Os'] = request.os;
  }
  if (!Util.isUnset(request.osType)) {
    query['OsType'] = request.osType;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  if (!Util.isUnset(request.willDistribute)) {
    query['WillDistribute'] = request.willDistribute;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAppImages',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listAppImages(request: ListAppImagesRequest): ListAppImagesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAppImagesWithOptions(request, runtime);
}

model ListAppTagesRequest {
  appId?: long(name='AppId'),
  appUid?: string(name='AppUid'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
}

model ListAppTagesResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      name?: string(name='Name'),
      uid?: string(name='Uid'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: long(name='TotalCount'),
}

model ListAppTagesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListAppTagesResponseBody(name='body'),
}

async function listAppTagesWithOptions(request: ListAppTagesRequest, runtime: Util.RuntimeOptions): ListAppTagesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.appUid)) {
    query['AppUid'] = request.appUid;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAppTages',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listAppTages(request: ListAppTagesRequest): ListAppTagesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAppTagesWithOptions(request, runtime);
}

model ListAppVersionAdaptorsRequest {
  id?: int32(name='Id'),
  versionId?: int32(name='VersionId'),
}

model ListAppVersionAdaptorsResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      bitrate?: string(name='Bitrate'),
      delete?: int32(name='Delete'),
      frameRate?: string(name='FrameRate'),
      gmtCreate?: string(name='GmtCreate'),
      gmtModified?: string(name='GmtModified'),
      hardware?: string(name='Hardware'),
      id?: long(name='Id'),
      mode?: string(name='Mode'),
      osType?: string(name='OsType'),
      reportUrl?: long(name='ReportUrl'),
      resolution?: string(name='Resolution'),
      runtimeEnv?: long(name='RuntimeEnv'),
      status?: int32(name='Status'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: long(name='TotalCount'),
}

model ListAppVersionAdaptorsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListAppVersionAdaptorsResponseBody(name='body'),
}

async function listAppVersionAdaptorsWithOptions(request: ListAppVersionAdaptorsRequest, runtime: Util.RuntimeOptions): ListAppVersionAdaptorsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  if (!Util.isUnset(request.versionId)) {
    query['VersionId'] = request.versionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAppVersionAdaptors',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listAppVersionAdaptors(request: ListAppVersionAdaptorsRequest): ListAppVersionAdaptorsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAppVersionAdaptorsWithOptions(request, runtime);
}

model ListAppVersionsRequest {
  appUid?: string(name='AppUid'),
  name?: string(name='Name'),
  number?: string(name='Number'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
}

model ListAppVersionsResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      adaptorComplishCount?: long(name='AdaptorComplishCount'),
      adaptorCount?: long(name='AdaptorCount'),
      gmtCreate?: string(name='GmtCreate'),
      gmtModified?: string(name='GmtModified'),
      listAdaptor?: string(name='ListAdaptor'),
      name?: string(name='Name'),
      number?: string(name='Number'),
      os?: string(name='Os'),
      osType?: string(name='OsType'),
      size?: long(name='Size'),
      uid?: string(name='Uid'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: long(name='TotalCount'),
}

model ListAppVersionsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListAppVersionsResponseBody(name='body'),
}

async function listAppVersionsWithOptions(request: ListAppVersionsRequest, runtime: Util.RuntimeOptions): ListAppVersionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appUid)) {
    query['AppUid'] = request.appUid;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.number)) {
    query['Number'] = request.number;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAppVersions',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listAppVersions(request: ListAppVersionsRequest): ListAppVersionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAppVersionsWithOptions(request, runtime);
}

model ListImageByAppIdRequest {
  appId?: long(name='AppId'),
  imageId?: long(name='ImageId'),
  number?: long(name='Number'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  versionName?: string(name='VersionName'),
}

model ListImageByAppIdResponseBody = {
  code?: string(name='Code'),
  data?: {
    appId?: long(name='AppId'),
    appName?: string(name='AppName'),
    description?: string(name='Description'),
    imageDOList?: [ 
      {
        adaptorId?: long(name='AdaptorId'),
        frameRate?: string(name='FrameRate'),
        hardware?: string(name='Hardware'),
        id?: string(name='Id'),
        imageUid?: string(name='ImageUid'),
        number?: string(name='Number'),
        os?: string(name='Os'),
        osType?: string(name='OsType'),
        resolution?: string(name='Resolution'),
        status?: int32(name='Status'),
        versionName?: string(name='VersionName'),
      }
    ](name='ImageDOList'),
    tagList?: [ 
      {
        appId?: string(name='AppId'),
        id?: string(name='Id'),
        name?: long(name='Name'),
      }
    ](name='TagList'),
  }(name='Data'),
  message?: string(name='Message'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: long(name='TotalCount'),
}

model ListImageByAppIdResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListImageByAppIdResponseBody(name='body'),
}

async function listImageByAppIdWithOptions(request: ListImageByAppIdRequest, runtime: Util.RuntimeOptions): ListImageByAppIdResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.imageId)) {
    query['ImageId'] = request.imageId;
  }
  if (!Util.isUnset(request.number)) {
    query['Number'] = request.number;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.versionName)) {
    query['VersionName'] = request.versionName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListImageByAppId',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listImageByAppId(request: ListImageByAppIdRequest): ListImageByAppIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return listImageByAppIdWithOptions(request, runtime);
}

model ListRegionIdsRequest {
  status?: int32(name='Status'),
}

model ListRegionIdsResponseBody = {
  code?: string(name='Code'),
  data?: [ string ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  totalCount?: long(name='TotalCount'),
}

model ListRegionIdsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListRegionIdsResponseBody(name='body'),
}

async function listRegionIdsWithOptions(request: ListRegionIdsRequest, runtime: Util.RuntimeOptions): ListRegionIdsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.status)) {
    body['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListRegionIds',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listRegionIds(request: ListRegionIdsRequest): ListRegionIdsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listRegionIdsWithOptions(request, runtime);
}

model ListWillDistributeAdaptorAppsRequest {
  appId?: long(name='AppId'),
  appName?: string(name='AppName'),
  os?: string(name='Os'),
  osType?: string(name='OsType'),
  pageNumber?: string(name='PageNumber'),
  pageSize?: string(name='PageSize'),
  runtimeEnv?: string(name='RuntimeEnv'),
  type?: int32(name='Type'),
}

model ListWillDistributeAdaptorAppsResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      adaptorUid?: long(name='AdaptorUid'),
      appId?: long(name='AppId'),
      appName?: string(name='AppName'),
      appUid?: long(name='AppUid'),
      bitrate?: string(name='Bitrate'),
      description?: string(name='Description'),
      frameRate?: string(name='FrameRate'),
      gmtCreate?: string(name='GmtCreate'),
      gmtModified?: string(name='GmtModified'),
      hardware?: string(name='Hardware'),
      iconUrl?: string(name='IconUrl'),
      imageUid?: string(name='ImageUid'),
      mode?: string(name='Mode'),
      os?: string(name='Os'),
      osType?: string(name='OsType'),
      reportUrl?: string(name='ReportUrl'),
      resolution?: string(name='Resolution'),
      runtimeEnv?: string(name='RuntimeEnv'),
      status?: int32(name='Status'),
      type?: int32(name='Type'),
      versionName?: string(name='VersionName'),
      versionNumber?: string(name='VersionNumber'),
      versionUid?: long(name='VersionUid'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: long(name='TotalCount'),
}

model ListWillDistributeAdaptorAppsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListWillDistributeAdaptorAppsResponseBody(name='body'),
}

async function listWillDistributeAdaptorAppsWithOptions(request: ListWillDistributeAdaptorAppsRequest, runtime: Util.RuntimeOptions): ListWillDistributeAdaptorAppsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.os)) {
    query['Os'] = request.os;
  }
  if (!Util.isUnset(request.osType)) {
    query['OsType'] = request.osType;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.runtimeEnv)) {
    query['RuntimeEnv'] = request.runtimeEnv;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListWillDistributeAdaptorApps',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listWillDistributeAdaptorApps(request: ListWillDistributeAdaptorAppsRequest): ListWillDistributeAdaptorAppsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listWillDistributeAdaptorAppsWithOptions(request, runtime);
}

model ModifyAppImageRequest {
  name?: string(name='Name'),
  uid?: string(name='Uid'),
}

model ModifyAppImageResponseBody = {
  code?: string(name='Code'),
  isSuccess?: boolean(name='IsSuccess'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model ModifyAppImageResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyAppImageResponseBody(name='body'),
}

async function modifyAppImageWithOptions(request: ModifyAppImageRequest, runtime: Util.RuntimeOptions): ModifyAppImageResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyAppImage',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyAppImage(request: ModifyAppImageRequest): ModifyAppImageResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyAppImageWithOptions(request, runtime);
}

model RecreateImageRequest {
  imageUid?: string(name='ImageUid'),
}

model RecreateImageResponseBody = {
  code?: string(name='Code'),
  data?: boolean(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model RecreateImageResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RecreateImageResponseBody(name='body'),
}

async function recreateImageWithOptions(request: RecreateImageRequest, runtime: Util.RuntimeOptions): RecreateImageResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.imageUid)) {
    query['ImageUid'] = request.imageUid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RecreateImage',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function recreateImage(request: RecreateImageRequest): RecreateImageResponse {
  var runtime = new Util.RuntimeOptions{};
  return recreateImageWithOptions(request, runtime);
}

model RefreshImageDataTestResponseBody = {
  code?: string(name='Code'),
  data?: long(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  totalCount?: long(name='TotalCount'),
}

model RefreshImageDataTestResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RefreshImageDataTestResponseBody(name='body'),
}

async function refreshImageDataTestWithOptions(runtime: Util.RuntimeOptions): RefreshImageDataTestResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'RefreshImageDataTest',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function refreshImageDataTest(): RefreshImageDataTestResponse {
  var runtime = new Util.RuntimeOptions{};
  return refreshImageDataTestWithOptions(runtime);
}

model StartCopyAppImageRequest {
  destinationRegionList?: [ string ](name='DestinationRegionList'),
  imgUid?: string(name='ImgUid'),
  sourceRegion?: string(name='SourceRegion'),
}

model StartCopyAppImageShrinkRequest {
  destinationRegionListShrink?: string(name='DestinationRegionList'),
  imgUid?: string(name='ImgUid'),
  sourceRegion?: string(name='SourceRegion'),
}

model StartCopyAppImageResponseBody = {
  code?: string(name='Code'),
  data?: [ string ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  totalCount?: long(name='TotalCount'),
}

model StartCopyAppImageResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: StartCopyAppImageResponseBody(name='body'),
}

async function startCopyAppImageWithOptions(tmpReq: StartCopyAppImageRequest, runtime: Util.RuntimeOptions): StartCopyAppImageResponse {
  Util.validateModel(tmpReq);
  var request = new StartCopyAppImageShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.destinationRegionList)) {
    request.destinationRegionListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.destinationRegionList, 'DestinationRegionList', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.destinationRegionListShrink)) {
    body['DestinationRegionList'] = request.destinationRegionListShrink;
  }
  if (!Util.isUnset(request.imgUid)) {
    body['ImgUid'] = request.imgUid;
  }
  if (!Util.isUnset(request.sourceRegion)) {
    body['SourceRegion'] = request.sourceRegion;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'StartCopyAppImage',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function startCopyAppImage(request: StartCopyAppImageRequest): StartCopyAppImageResponse {
  var runtime = new Util.RuntimeOptions{};
  return startCopyAppImageWithOptions(request, runtime);
}

model UpdateAppRequest {
  description?: string(name='Description'),
  iconUrl?: string(name='IconUrl'),
  id?: long(name='Id'),
  name?: string(name='Name'),
  type?: long(name='Type'),
}

model UpdateAppResponseBody = {
  code?: string(name='Code'),
  data?: boolean(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model UpdateAppResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateAppResponseBody(name='body'),
}

async function updateAppWithOptions(request: UpdateAppRequest, runtime: Util.RuntimeOptions): UpdateAppResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.iconUrl)) {
    query['IconUrl'] = request.iconUrl;
  }
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateApp',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateApp(request: UpdateAppRequest): UpdateAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAppWithOptions(request, runtime);
}

model UpdateAppVersionRequest {
  appId?: long(name='AppId'),
  id?: long(name='Id'),
  name?: string(name='Name'),
  number?: string(name='Number'),
}

model UpdateAppVersionResponseBody = {
  code?: string(name='Code'),
  data?: boolean(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model UpdateAppVersionResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateAppVersionResponseBody(name='body'),
}

async function updateAppVersionWithOptions(request: UpdateAppVersionRequest, runtime: Util.RuntimeOptions): UpdateAppVersionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.number)) {
    query['Number'] = request.number;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateAppVersion',
    version = '2021-07-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateAppVersion(request: UpdateAppVersionRequest): UpdateAppVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAppVersionWithOptions(request, runtime);
}

